const express = require('express');
const router = express.Router();
const crawlerService = require('../services/crawler');

router.get('/', async (req, res, next) => {
    try {
        const posts = await crawlerService.scrapeForum();
        res.json({
            success: true,
            data: posts
        });
    } catch (error) {
        next(error);
    }
});

module.exports = router;